<script type="text/javascript">
//<![CDATA[
	function frmValid(){
		with(document.frmReg){
			submit();
		}
	}

	function frmDelete(){
		if(!confirm('삭제 하시겠습니까?'))return;
		with(document.frmReg){
			dbjob.value = 'd';
			submit();
		}	 
	}
	
	$.datepicker.setDefaults({
		dateFormat: 'yy-mm-dd'
	});

	$(function(){
		//삭제버튼
		
		if($("[name=dbjob]").val() == 'u'){ 
			$(".btnDelete").show();
		}else{
			$(".btnDelete").hide();
		}
		
		$(".datepicker").datepicker();
		$(".btn_calendar").click(function(){
			var index = $(".btn_calendar").index($(this));
			$('.datepicker').eq(index).datepicker('show');	
		});

	});

//]]>
</script>
<div class="box_type02">
	<h2 class="txt">배경음악</h2>
	<p class="icon"><a href="javascript:void(0);" class="icon_m04">매뉴얼</a></p>
	<form name="frmReg" method="post" action="/setting/bgmDbjob" enctype="multipart/form-data">
	<input type="hidden" name="dbjob" value="<?php echo $dbjob?>">
	<input type="hidden" name="id" value="<?php echo $bgm_id?>">
	<fieldset class="board_write">
		<legend>배경음악</legend>
		<table cellspacing="0" summary="배경음악" class="lines">
			<caption>배경음악</caption>
			<tr>
				<th scope="row"><label for="st_day" class="point">게시 기간</label></th>
				<td>
					<div>
						<input type="text" id="st_day" name="start_date" class="datepicker ip_i" style="width:148px;" value="<?php echo $start_date;?>" />
						<a href="javascript:void(0);" class="btn_calendar">달력보기</a>
						<span class="txt_type01">~</span>
						<input type="text" id="st_day2" name="end_date" class="datepicker ip_i" style="width:148px;" value="<?php echo $end_date;?>" />
						<a href="javascript:void(0);" class="btn_calendar">달력보기</a>
					</div>
				</td>
			</tr>
			<tr>
				<th scope="row"><label for="st_day" class="point">음악 선택</label></th>
				<td>
					<div>
						<input type="file" id="" name="files[]" class="ip_i" style="width:410px;" value="" /> <span class="txt_type01">- 1M 미만, WAV파일</span>
					</div>
					<?php 
						if($bgm_info){
							$bgm_file = explode('|',$bgm_info);
							echo '<div><span class="txt_type01"><strong>BGM :</strong>'.$bgm_file[1].'</span></div>';
						}
					?>
				</td>
			</tr>
			<tr>
				<th scope="row"><label for="st_day" class="point">사용</label></th>
				<td>
					<div>
						<select name="open_yn" class="ip_s ml6" style="width:50px;">
							<option value="Y" <?php if($open_yn == 'Y'){?>selected<?php }?>>Yes</option>
							<option value="N" <?php if($open_yn == 'N'){?>selected<?php }?>>No</option>
						</select>
					</div>
				</td>
			</tr>
		</table>
	</fieldset>
	</form>

	<!-- [s] 버튼 -->
	<ul class="botton_box mt30">
		<li class="center">
			<a href="javascript:frmValid();"><img src="/theme/<?=$_theme?>/images/common/btn_ok.gif" alt="확인" /></a>
			<a href="javascript:frmDelete();" class="btnDelete"><img src="/theme/<?=$_theme?>/images/common/btn_delete.gif" alt="삭제" /></a>
			<a href="javascript:frmReg.reset();"><img src="/theme/<?=$_theme?>/images/common/btn_cancel.gif" alt="취소" /></a>
		</li>
	</ul>
	<!-- [e] 버튼 -->

	<!--[s] Tip -->
	<dl id="tip" class="mt30">
		<dt>Tip</dt>
		<dd>인터넷익스플로러의 '호환성보기' 기능을 사용중인 접속자에게 자동으로 최신버전 기준으로 사이트를 출력하도록 처리합니다.</dd>
		<dd>코딩방식에 따라 특정 버전의 브라우저에서 사이트가 깨질수 있으니, 충분한 테스트 후 기능을 설정해 주시기 바랍니다.</dd>
	</dl>
	<!--[e] Tip -->
</div>